package com.xuan.contest.common.config;

import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author XinZhaoXuan
 * @date 2018/7/23
 */
@Configuration
@EnableTransactionManagement
@MapperScan(basePackages = {"com.xuan.contest.dao.*"})
public class MybatisPlusConfig {
    /**
     * 分页插件，自动识别数据库类型
     * @return
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }
}
